<?php
class Admin_OrderController extends Zend_Controller_Action
{
    public function init()
    {
        $this->_helper->layout()->setLayout('layout_admin');
    }
    public function indexAction()
    {
        
        $orderModel=new Admin_Model_MOrder();
        $total=0;
        $currentpage=(int)$this->getRequest()->getParam('currentpage',1);
        $pagesize=10;
        $order=$orderModel->getNewOrder($total, $currentpage);

        $this->view->total=$total;
        $this->view->order=$order;
        $this->view->currentpage=$currentpage;
        $this->view->pagesize=$pagesize;

        //$bookModel=new Admin_Model_MBook();
        //$bookModel->updateDateOfBook();   // không được chạy 2 lần
    }

    public function detailAction()
    {
        $oid=$this->getRequest()->getParam('oid');
        $orderModel=new Admin_Model_MOrder();
        $orderInfo=$orderModel->getInfoOrder($oid);
        if(count($orderInfo)>0)
        {
            $this->view->orderInfo=$orderInfo;
        }
    }
}

?>
